package com.sims.action;

import com.sims.service.IUserService;
import com.sims.service.impl.UserServiceImp;

public class LoginAction {
	private String userAccount;
	private String userPassword;
	public String getUserAccount() {
		return userAccount;
	}
	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}
	public String getUserPassword() {
		return userPassword;
	}
	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}
	
	public String execute() throws Exception {
		boolean validate =false;
		IUserService userVice =new UserServiceImp();
		validate = userVice.validateLogin(userAccount, userPassword);
		
		if(validate){
			return "success";
		}else{
			return "error";
		}
	}

}
